package semana3.strings.ejemplos.ej11_cadeaAlReves;

import java.util.Scanner;

public class CadenaAlReves {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		System.out.println("Introduce una frase: ");
		String frase = scan.nextLine();
		System.out.println(cadeaReves(frase));
	}

	public static String cadeaReves(String cadena) {
		String cadenaReves = "";
		for (int i = cadena.length()-1; i >= 0; i--) {
			cadenaReves = cadenaReves + cadena.charAt(i);
		}
		return cadenaReves;
	}
}
